﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Owin.Hosting;
using Ymatou.ServiceCenter;

namespace WebApiDemoOwinSelfHost
{
    class Program
    {
        private const int DefaultPort = 9900, DefaultMaxNumConnections = 1000, DefaultBufferSize = 60000;
        static void Main(string[] args)
        {
            try
            {
                ServiceRegisterManager.InitRpc();
                //SocketListener listener = new SocketListener(DefaultMaxNumConnections, DefaultBufferSize);
                //listener.Start(new IPEndPoint(IPAddress.Parse("127.0.0.1"), DefaultPort));
                using (WebApp.Start<Startup>("http://localhost:3333"))
                {
                    Console.ReadLine();
                }
                Console.WriteLine("ok");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.ReadLine();
        }
    }
}
